var _o80;
var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var s = cc._decorator.ccclass;
var def_QQ_BlockAd = _o80 = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
    this._posX = .5;
    this._posY = 1;
    this.blockAd = null;
  }
  return babel_createClass(_ctor, [{
    key: "show",
    value: function show(e, t) {
      var _this69 = this;
      if (window.qq && window.qq.createBlockAd) {
        if (null == this.blockAd) {
          var _n39 = wx.getSystemInfoSync();
          var _o81 = _n39.windowWidth;
          var _i22 = _n39.windowHeight;
          this._posX = t ? t.x : .5;
          this._posY = t ? t.y : .5;
          console.log("创建qq blockAd", e);
          this.blockAd = window.qq.createBlockAd({
            adUnitId: e,
            size: 2,
            orientation: "vertical",
            style: {
              left: (_o81 - 80) * this._posX,
              top: (_i22 - 100) * this._posY
            }
          });
          this.blockAd.onLoad(function (e) {
            console.log("blockAd onLoad", e);
            _this69.blockAd.show();
          });
          this.blockAd.onError(function (e) {
            console.log("blockAd onError", e);
          });
          this.blockAd.onResize(function () {
            if (this.blockAd) {
              this.blockAd.style.left = (_o81 - this.blockAd.style.realWidth) * this._posX;
              this.blockAd.style.top = (_i22 - this.blockAd.style.realHeight) * this._posY;
              console.log(this.blockAd.style);
              this._blockHeight = this.blockAd.style.realWidth;
              this._blockHeight = this.blockAd.style.realHeight;
            }
          }.bind(this));
        }
        console.log("showqq blockAd", e);
        this.blockAd.show();
      }
    }
  }, {
    key: "resetPos",
    value: function resetPos(e) {
      var t = wx.getSystemInfoSync();
      var n = t.windowWidth;
      var _o82 = t.windowHeight;
      this.blockAd.style.left = (n - this._blockWidth) * e.x;
      this.blockAd.style.top = (_o82 - this._blockHeight) * e.y;
    }
  }, {
    key: "hide",
    value: function hide() {
      console.log("hideqq blockAd");
      if (null != this.blockAd) {
        this.blockAd.hide();
        this.blockAd.destroy();
        this.blockAd = null;
      }
    }
  }], [{
    key: "getInstance",
    value: function getInstance() {
      _o80._instance || (_o80._instance = new _o80());
      return _o80._instance;
    }
  }]);
}();
def_QQ_BlockAd = _o80 = cc__decorate([s], def_QQ_BlockAd);
exports.default = def_QQ_BlockAd;